package com.lbmb.photodrawaimanager.controller;

import com.lbmb.photodrawaimanager.entity.req.TitleReq;
import com.lbmb.photodrawaimanager.entity.resp.TitleResp;
import com.lbmb.photodrawaimanager.service.TitleService;
import com.lbmb.photodrawaimanager.utils.Response;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * @author hanWang
 * @Title:
 * @Package
 * @Description:
 * @date 2023/8/26:06 下午
 */
@RestController
@RequestMapping("/ap/v1/title/manager")
@Slf4j
public class TitleController {

    @Autowired
    private TitleService titleService;

    @PostMapping("/query_title_by_param")
    public Response<List<TitleResp>> queryAllTitle(@RequestBody TitleReq req){
        return Response.ok(titleService.queryAllTitle(req));
    }

    @RequestMapping("/save_title_by_param")
    public Response<Boolean> saveAllTitle(@RequestBody  TitleReq req){
        return Response.ok(titleService.saveTitle(req));
    }

    @RequestMapping("/update_status")
    public Response<Boolean> upStatus(@RequestParam("id") Long id){
        return Response.ok(titleService.upStatus(id));
    }


}


